home *** CD-ROM | disk | FTP | other *** search
-
- function units_amphibia_setup()
- units_setup(4,false,ENET_EFFECT_PS_SETUPSMOKE_SMALL,ENET_EFFECT_GEOMETRY_AMPHIBIASHADOW)
- end
-
- function units_amphibia_resetup()
- units_setup(4,false,nil,ENET_EFFECT_GEOMETRY_AMPHIBIASHADOW)
- end
-
- function units_amphibia_select()
- units_select(22,1)
- end
-
- function units_amphibia_unselect()
- units_unselect()
- end
-
- function units_amphibia_selectenemy()
- uniGetExecutor():addSimpleEffect(ENET_EFFECT_SELECTEDGEOMETRY_ENEMY)
- end
-
- function units_amphibia_damaged()
- uniGetExecutor():applyDamage(uniGetLife())
- end
-
- function units_amphibia_highlight()
- uniGetExecutor():addEffectWithRadius(ENET_EFFECT_GEOMETRY_HIGHLIGHT,15)
- end
-
- function units_amphibia_explode()
- units_explode_small3()
- end
-
- function units_amphibia_move()
- local unit = uniGetExecutor()
- local sound = unit:play3DSound("amphibia_move.wav",1)
- local steps = {}
- unit:getBone(ENBT_GUNTOWER):addRotationEffect(ENET_EFFECT_ROTATE_GUNTOWERDEFAULT,MATH_PI)
- local eng_smoke2 = unit:addSimpleEffect(ENET_EFFECT_PS_NEWTRACKSMOKE4)
- waitDeath(unit:addRotationEffect(ENET_EFFECT_ROTATE_UNIT,MATH_PI * 1.0))
- waitDeath(unit:addMoveEffect(ENET_EFFECT_MOVE_LINEAR,100))
- eng_smoke2:suspendedDestroy(5.0)
- sound:destroy()
- unit:play3DSound("amphibia_stop.wav",0):destroy()
- end
-
- function units_amphibia_fire()
- local unit = uniGetExecutor()
- local gt = unit:getBone(ENBT_GUNTOWER)
- local sound = gt:play3DSound("amphibia_guntower_rotate.wav",1)
- waitDeath(gt:addRotationEffect(ENET_EFFECT_ROTATE_GUNTOWERTOTARGET,MATH_PI,uniGetTarget()))
- local gun = gt:getBone(ENBT_GUN)
- -- waitDeath(gun:addRotationEffect(ENET_EFFECT_ROTATE_GUNTOTARGET,MATH_PI / 3.0,uniGetTarget()))
- sound:stopSound()
- local firespot = gt:getBone(ENBT_FIRE1)
- local fire = firespot:addSimpleEffect(ENET_EFFECT_PS_FLAMETHROWERFIRE)
- sound = gt:play3DSound("flamethrower_fire.wav",1)
- local shot = firespot:addBulletEffect(ENET_EFFECT_BULLET_FLAMETHROWERFIRE)
- shot:executeCommand(ENC_FIRE1)
- local rot
- rot = gt:addRotationEffect(ENET_EFFECT_ROTATE_RADAR,0.5)
- pause(0.6)
- rot:destroy()
- rot = gt:addRotationEffect(ENET_EFFECT_ROTATE_RADAR,-0.5)
- pause(1.2)
- rot:destroy()
- rot = gt:addRotationEffect(ENET_EFFECT_ROTATE_RADAR,0.5)
- pause(1.2)
- rot:destroy()
- fire:suspendedDestroy(2.5)
- pause(1.0)
- sound:stopSound()
- gt:play3DSound("flamethrower_fire_end.wav",0):destroy()
- unit:addFireArrow()
- end
-
- registerCommand(ENSCRIPTSET_AMPHIBIA,ENC_MOVE,"units_amphibia_move")
- registerCommand(ENSCRIPTSET_AMPHIBIA,ENC_FIRE1,"units_amphibia_fire")
- registerCommand(ENSCRIPTSET_AMPHIBIA,ENC_FIRE2,"units_amphibia_fire")
- registerCommand(ENSCRIPTSET_AMPHIBIA,ENC_SELECT,"units_amphibia_select")
- registerCommand(ENSCRIPTSET_AMPHIBIA,ENC_SELECTENEMY,"units_amphibia_selectenemy")
- registerCommand(ENSCRIPTSET_AMPHIBIA,ENC_UNSELECT,"units_amphibia_unselect")
- registerCommand(ENSCRIPTSET_AMPHIBIA,ENC_SETUP,"units_amphibia_setup")
- registerCommand(ENSCRIPTSET_AMPHIBIA,ENC_RESETUP,"units_amphibia_resetup")
- registerCommand(ENSCRIPTSET_AMPHIBIA,ENC_DAMAGED,"units_amphibia_damaged")
- registerCommand(ENSCRIPTSET_AMPHIBIA,ENC_EXPLODE,"units_amphibia_explode")
- registerCommand(ENSCRIPTSET_AMPHIBIA,ENC_HIGHLIGHT,"units_amphibia_highlight")
- registerCommand(ENSCRIPTSET_AMPHIBIA,ENC_INSIDE,"units_inside")
-
- -- make description of unit
- desc = getEffectDescriptionP(ENET_UNIT_AMPHIBIA)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "amphibia.rmd"
- desc.ScriptSet = ENSCRIPTSET_AMPHIBIA
- desc.MoveType = ENMOVE_AMPHIBIAN
- desc.RenderType = ENRENDERTYPE_GEOMETRY
- desc.Material = ENMAT_RIGIDSKINNEDMESH
- desc.MaterialColors = units_materialcolors_human
-
- -- shadow
- desc = getEffectDescriptionP(ENET_EFFECT_GEOMETRY_AMPHIBIASHADOW)
- desc.ClassID = ENCLASS_MESHINSTANCE
- desc.EffectClassType = ENECT_GEOMETRY
- desc.FileName = "amphibia_shadow.rmd"
- desc.RenderType = ENRENDERTYPE_SHADOW
- desc.Material = ENMAT_SHADOW
- desc.MaterialColors = units_materialcolors_shadow
-
- -- register new unit to logic
- unitDesc = logic_getUnitDescP(7)
- unitDesc.group = 1
- unitDesc.order = 1
- unitDesc.unit_res_id = ENET_UNIT_AMPHIBIA
- unitDesc.unit_icon_id = "Amphibia_h_small_normal.dds"
- unitDesc.active_id = "Amphibia_h_small_active.dds"
- unitDesc.pressed_id = "Amphibia_h_small_pressed.dds"
- unitDesc.big_icon_id = "Amphibia_h_big_normal.dds"
- unitDesc.small_icon_id = "Amphibia_u_stats.dds"
- unitDesc.HP = 4
- unitDesc.MP = 30
- unitDesc.WR = 1
- unitDesc.min_WR = 1
- unitDesc.WD = 2
- unitDesc.WR2 = 0
- unitDesc.min_WR2 = 0
- unitDesc.WD2 = 0
- unitDesc.ability = 2
- unitDesc.transport = 0
- unitDesc.value = 3
- unitDesc.race = 0
- unitDesc.fire_pause = 0.75
- unitDesc.move_pause = 1.0
- unitDesc.unit_info_scale = 0.06
- unitDesc.scn_name = "AMPHIBIA"
-
- ------------------------------------------------------------------------------------------------------
- ------------------------ effects related to unit------------------------------------------------------
- ------------------------------------------------------------------------------------------------------
-
- function bullets_flamethrower_fire()
- local bullet = uniGetExecutor()
- bullet:setTransformOwner()
- waitDeath(bullet:addMoveEffect(ENET_EFFECT_MOVE_LINEARFLY,66,uniGetTarget()),1000)
- local hit_ps = bullet:addSimpleEffect(ENET_EFFECT_PS_FLAMETHROWERFIREHIT)
- pause(2.5)
- local hit_ps2 = bullet:addSimpleEffect(ENET_EFFECT_PS_FLAMETHROWERAFTERFIRE)
- pause(0.5)
- hit_ps:suspendedDestroy(2.0)
- uniGetTarget():executeCommand(ENC_DAMAGED)
- pause(2.5)
- hit_ps2:suspendedDestroy(2.0)
- pause(2.0)
- bullet:destroy()
- end
-
- registerCommand(ENSCRIPTSET_BULLET_FLAMETHROWERFIRE,ENC_FIRE1,"bullets_flamethrower_fire")
-